
/**
 *
 * @author pc
 */
import java.util.Scanner;
 class exam1{
    private String hoten;
    private String Mssv;
    private float diem;
    void sethoten(String hoten){
        this.hoten=hoten;
    }


    void setMssv(String Mssv){
        this.Mssv=Mssv;
    }


    void setdiem(Float diem){
        this.diem=diem;
    }


    void hienthi(){
        System.out.printf("%-20s" ,hoten);
        System.out.printf("%-15s",Mssv);
        System.out.printf("%7.2f",diem);
        System.out.println();
        
    }

    public static void main(String[] args) {
        int i,n;
        float tb=0;
        exam1[] sv=new exam1[50];
        if(args.length==0) System.out.println("LOI");
        if(args.length>1) System.out.println("LOI");
        if(args.length==1){
        n=Integer.parseInt(args[0]);

        // nhap thong tin
            for( i=0;i<n;i++){  
                Scanner sc= new Scanner(System.in);
                sv[i]=new exam1();
                System.out.print("Nhap ten sv thu: "+(i+1)+": ");
                sv[i].sethoten(sc.nextLine());
                System.out.print("NhapMasosinh vien thu: "+(i+1)+": ");
                sv[i].setMssv(sc.nextLine());
                System.out.print("Nhap diem sv thu: "+(i+1)+": ");
                sv[i].setdiem(sc.nextFloat());
            }


            System.out.println("Danh sach sinh vien ban vua nhap vao la:");
            for( i=0;i<n;i++){
                tb=tb+sv[i].diem;//tinh diem trung binh
                sv[i].hienthi();
            }
           System.out.printf("Diem trung binh : %7.2f \n" ,(tb/n));


            // tim kiem phan tu co so diem nho nhat
            float d=sv[0].diem;
            // tim diem thap nhat
            for( i=1;i<n;i++){
               if(d>sv[i].diem) d=sv[i].diem;
            }
            // hien thi diem thap nhat
            System.out.println("Danh sach sv co diem thap nhat:");
            for(i=0;i<n;i++){
                if(sv[i].diem==d) sv[i].hienthi();
            }


            // tim kiem phan tu co diem cao nhat
            float e=sv[0].diem;
             // tim diem cao nhat
            for( i=1;i<n;i++){
               if(e<sv[i].diem) e=sv[i].diem;
            }
            // hien thi diem cao nhat
            System.out.println("Danh sach sv co diem cao nhat:");
            for(i=0;i<n;i++){
                if(sv[i].diem==e) sv[i].hienthi();
            }


            // hien thi sv khong qua mon
            System.out.println("Danh sach sinh vien khong qua:");
            for(i=0;i<n;i++){
                if(sv[i].diem<4) sv[i].hienthi();
            }
            
        }
        
    }
}